import { registerMapItem, type MapItem } from '@/map-item'
import { entityMapItem, entityMapItemType } from '../base'
import type { Aircraft } from './types'
import AircraftInfoVue from './AircraftInfo.vue'

export function initAircraftMapItems() {
  registerMapItem<Aircraft>({
    type: entityMapItemType('Aircraft'),
    typeName: '飞机',
    icon: 'mas-icon-Aircraft',
    getName: (t) => t.id,
    infoView: AircraftInfoVue
  })
}

export function aircraftMapItem(id: string): MapItem<Aircraft> {
  return entityMapItem('Aircraft', id)
}
